﻿using NewLife.Security;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WomanMotion.WebApi.Infrastructure.Common
{
    /// <summary>
    /// 常用静态工具类
    /// </summary>
    public static class Tools
    {
        /// <summary>
        /// 随机字符方法
        /// </summary>
        /// <param name="length">长度</param>
        /// <returns></returns>
        public static string Radomstrs(int length)
        {
            Random random = new Random();
            string chars = "ABCDEFGHIJKLMNOPQRSTUWVXYZ0123456789abcdefghijklmnopqrstuvwxyz";
            string strs = string.Empty;
            for (int i = 0; i < length; i++)
            {
                strs += chars[random.Next(chars.Length)];
            }
            return strs;
        }
    }
}